import request from '@/utils/request'

export function getExamInfo(
  page: number,
  pageSize: number,
  studentId: string,
  stuName: string,
  className: string,
  examDate: Date,
  examState: string,
  examScore: number
) {
  return request({
    url:
      '/admin/exam/getExamInfo?page=' +
      page +
      '&pageSize=' +
      pageSize +
      '&studentId=' +
      studentId +
      '&stuName=' +
      stuName +
      '&className=' +
      className +
      '&examDate=' +
      examDate +
      '&examState=' +
      examState +
      '&examScore=' +
      examScore,
    method: 'get'
  })
}

export function setExamScore(data: object) {
  return request({
    url: '/admin/exam/setExamScore',
    method: 'put',
    data: data
  })
}

export function passByIds(ids: number[]) {
  return request({
    url: '/admin/exam/passByExamIds/' + ids,
    method: 'put'
  })
}

export function noPassByIds(ids: number[]) {
  return request({
    url: '/admin/exam/noPassByExamIds/' + ids,
    method: 'put'
  })
}

export function ExportExcelSignUpInfo(examState: string, className: string) {
  return request({
    url: '/admin/export/examTable?examState=' + examState + '&className=' + className,
    method: 'get',
    responseType: 'blob'
  })
}
